li

Usage: li

li fits the data using a linear fitting algorithm. No iteration is required since the best-fit parameters are uniquely determined by the data and basis functions. The linear fitting algorithm used is the simplest possible. A matrix equation is set up and solved by Gauss-Jordan elimination. A singular matrix will cause a failure of the method and probably indicates a linearly dependent basis set. A near-singular matrix will cause inaccuracies in parameter values.

li will usually work very well for less than 6 or so basis functions and reasonably well for up to about 10 basis functions. If you have problems with singular matrices, doubt the accuracy of your parameters, or want to incorporate errors in the independent parameters, I suggest that you use li to obtain initial guesses and then use fi for to find the final parameter values. fi will usually converge quickly if you start with initial guesses obtained from li.

You should be aware that fitting to a subset of parameters with the sp command has a different effect with li than it does with fi. With fi, the selected parameters are varied while the unselected parameters are held fixed. With li, the selected parameters really define which basis functions are incorporated in the fit. These are the only parameters found, the other parameters are set to zero. This may be inconvenient in certain situations, but it reflects a basic difference between linear and non-linear fitting.